package com.company.project.core;

/**
 * 响应码枚举，参考HTTP状态码的语义
 */
public enum ResultCode {
    SUCCESS(200,"操作成功"),//成功
    FAIL(400,"操作成功"),//失败
    UNAUTHORIZED(401,"签名错误"),//未认证（签名错误）
    NOT_FOUND(404,"接口不存在"),//接口不存在
    INTERNAL_SERVER_ERROR(500,"系统异常"),
    ROLE_CONFIG_ERROR(1001,"管理员尚未配置此类型用户对应的角色，请联系管理员"),
    OLD_PASSWORD_ERROR(1002,"原始密码错误"),
    IDCARD_ERROR(1003,"身份证号不允许为空"),
    IDCARD_CONFIG_ERROR(1004,"系统尚未录入您的信息，请联系管理员"),
    ;


    private  int code;

    private String msg;

    ResultCode(int code) {
        this.code = code;
    }

    ResultCode(int code,String msg) {
        this.code = code;
        this.msg = msg;
    }

    public int code() {
        return code;
    }

    public String msg(){return  msg;}
}
